home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / IF_SHAPE.{8U < prev    next >
Text File  |  1999-09-17  |  2KB  |  64 lines

  1. #ifndef __LINUX_SHAPER_H
  2. #define __LINUX_SHAPER_H
  3.  
  4. #ifdef __KERNEL__
  5.  
  6. #define SHAPER_QLEN    10
  7. /*
  8.  *    This is a bit speed dependent (read it shouldn't be a constant!)
  9.  *
  10.  *    5 is about right for 28.8 upwards. Below that double for every
  11.  *    halving of speed or so. - ie about 20 for 9600 baud.
  12.  */
  13. #define SHAPER_LATENCY    (5*HZ)
  14. #define SHAPER_MAXSLIP    2
  15. #define SHAPER_BURST    (HZ/50)        /* Good for >128K then */
  16.  
  17. struct shaper
  18. {
  19.     struct sk_buff_head sendq;
  20.     __u32 bytespertick;
  21.     __u32 bitspersec;
  22.     __u32 shapelatency;
  23.     __u32 shapeclock;
  24.     __u32 recovery;        /* Time we can next clock a packet out on
  25.                    an empty queue */
  26.     unsigned long locked;
  27.     struct device *dev;
  28.     int  (*hard_start_xmit) (struct sk_buff *skb,
  29.         struct device *dev);
  30.     int  (*hard_header) (struct sk_buff *skb,
  31.         struct device *dev,
  32.         unsigned short type,
  33.         void *daddr,
  34.         void *saddr,
  35.         unsigned len);
  36.     int  (*rebuild_header)(struct sk_buff *skb);
  37.     int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh);
  38.     void (*header_cache_update)(struct hh_cache *hh, struct device *dev, unsigned char *  haddr);
  39.     struct net_device_stats* (*get_stats)(struct device *dev);
  40.     struct wait_queue *wait_queue;
  41.     struct timer_list timer;
  42. };
  43.  
  44. #endif
  45.  
  46. #define SHAPER_SET_DEV        0x0001
  47. #define SHAPER_SET_SPEED    0x0002
  48. #define SHAPER_GET_DEV        0x0003
  49. #define SHAPER_GET_SPEED    0x0004
  50.  
  51. struct shaperconf
  52. {
  53.     __u16    ss_cmd;
  54.     union
  55.     {
  56.         char     ssu_name[14];
  57.         __u32    ssu_speed;
  58.     } ss_u;
  59. #define ss_speed ss_u.ssu_speed
  60. #define ss_name ss_u.ssu_name
  61. };
  62.  
  63. #endif
  64.